import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
import { type PaginationProps } from "@pureadmin/table";

type resultAPI = {
  isSuccess?: boolean;
  msg?: string;
  pageInfo?: object;
  result?: Array<any>;
  onePage?: PaginationProps;
};

export const executeSQL = (data?: object) => {
  return http.request<resultAPI>("post", baseUrlApi("AICode/ExeSql"), {
    data
  });
};

export const ExePython = (data?: object) => {
  return http.request<resultAPI>("post", baseUrlApi("AICode/ExePython"), {
    data
  });
};

//获取AI配置信息表,这里是测试的。
export const getAIConfig = () => {
  return http.request<resultAPI>("post", baseUrlApi("AICode/getAIConfig"), {});
};
